<?php

	/**
	 * @see Bike_Js_Ext_Msg_Show
	 */
	require_once 'Bike/Js/Ext/Msg/Show.php';
	
	
	class Bike_Js_Ext_Msg_Question extends Bike_Js_Ext_Msg_Show
	{
		protected function initDefaultSettings()
		{
			parent::initDefaultSettings();
		
			$js = $this->js();
			$this->setSettings(array(
				'fn' => $this->getJsFn(),
			));
		}
		
		/**
		 * Get JS fn
		 *
		 * @return Bike_Js_Interface_Js object
		 */
		protected function getJsFn()
		{
			if(!$this->getParamCache(__METHOD__))
			{
				$js = $this->js();
				
				$jsBtn = $js->btn;
				$this->setParamCache(__METHOD__,
					$js->function($jsBtn)->_body(array(
			     		$js->alert($jsBtn),
			     	))
				);
			}
			return $this->getParamCache(__METHOD__);
		}
		
		/**
		 * Get JS buttons
		 *
		 * @return Bike_Js_Interface_Js object
		 */
		protected function getJsButtons()
		{
			if(!$this->getParamCache(__METHOD__))
			{
				$js = $this->js();
		
				$this->setParamCache(__METHOD__, $js->Ext->Msg->YESNO);
			}
			return $this->getParamCache(__METHOD__);
		}
		
		/**
		 * Get JS icon
		 *
		 * @return Bike_Js_Interface_Js object
		 */
		protected function getJsIcon()
		{
			if(!$this->getParamCache(__METHOD__))
			{
				$js = $this->js();
		
				$this->setParamCache(__METHOD__, $js->Ext->Msg->QUESTION);
			}
			return $this->getParamCache(__METHOD__);
		}
	}
